<template>
  <div>
    <h2>Child</h2>
    <button @click="$emit('add-count')">加1</button>
    <button @click="$emit('addn-count', 2)">加n</button>
    <!-- 解绑某一个 -->
    <button @click="$off('add-count')">解绑add-count自定义事件</button>
    <!-- 解绑多个 -->
    <button @click="$off(['add-count', 'addn-count'])">
      解绑多个自定义事件
    </button>
    <!-- 解绑所有 -->
    <button @click="$off()">解绑所有自定义事件</button>
  </div>
</template>

<script>
export default {
  name: "Child",
};
</script>

<style></style>